package com.qingke.mybatis.I6;

import org.apache.ibatis.session.SqlSession;

import com.qingke.SessionManager;
import com.qingke.mapping.BlogMapper;
import com.qingke.pojo.Blog;
import com.qingke.pojo.User;



public class App {

	public static void main(String[] args) {
		SqlSession session =SessionManager.getInstance().getSession();
		BlogMapper mapper = session.getMapper(BlogMapper.class);
		
		//SqlSession session = factory.openSession();
		//System.out.println(session);
		String sql = "com.qingke.mapping.userMapper.selectById2";
	
		User user = session.selectOne(sql,10);
		System.out.println(user.getBlogs().size());
		for(Blog b:user.getBlogs()){
			System.out.println(b);
		}
		
		
		
		//mapper.delect(3);
		session.commit();
		session.close();
		//System.out.println(blog.getId());
		
	}
	

}
